import { Inject, Controller, Get, Query } from '@midwayjs/core';
import { Context } from '@midwayjs/koa';
import { MemberService } from '../service/Member.service';

@Controller('/')
export class MemberController {
  @Inject()
  ctx: Context;

  @Inject()
  memberService: MemberService;

  @Get('/member')
  async getUser(@Query('id') id,@Query('name') name,@Query('age') age) {
    console.log(this.ctx.path)
    const member = await this.memberService.getUser({ id, name, age });
    return { success: true, message: 'OK', data: member };
  }
}
